import * as types from '@/store/mutation-types'
export default {
  state: {
    accountInfo: {}
  },
  mutations: {
    [types.SET_ACCOUNT_INFO] (state, accountInfo) {
      state.accountInfo = accountInfo
    }
  },
  actions: {
    setAccountInfo ({ commit }, userInfo = {}) {
      commit(types.SET_ACCOUNT_INFO, userInfo)
    }
  },
  getters: {
    hasAccountInfo: (state) => {
      const accountInfo = state.accountInfo
      const keys = Object.keys(accountInfo)
      return keys.length > 0
    }
  },
  modules: {
  }
}
